
[dbo].[PotentialMatchingGift]
CREATE TABLE [dbo].[PotentialMatchingGift]
(
[PotentialMatchingGiftKey] [uniqueidentifier] NOT NULL,
[OrderLineKey] [uniqueidentifier] NOT NULL,
[MatchingGiftPlanKey] [uniqueidentifier] NULL,
[MatchingGiftRelationshipKey] [uniqueidentifier] NULL,
[MatchingGiftInformation] [nvarchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[DateCreated] [datetime] NOT NULL,
[DateMatchingGiftFormReceived] [datetime] NULL,
[DateMatchingFormSubmitted] [datetime] NULL,
[Amount] [decimal] (18, 4) NOT NULL CONSTRAINT [DF_PotentialMatchingGift_Amount] DEFAULT ((0)),
[UpdatedByUserKey] [uniqueidentifier] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[CreatedByUserKey] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[SystemEntityKey] [uniqueidentifier] NOT NULL,
[MarkedForDeleteOn] [datetime] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[PotentialMatchingGift] ADD CONSTRAINT [PK_PotentialMatchingGift] PRIMARY KEY CLUSTERED ([PotentialMatchingGiftKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_PotentialMatchingGift_CreatedByUserKey] ON [dbo].[PotentialMatchingGift] ([CreatedByUserKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_PotentialMatchingGift_MatchingGiftPlanKey] ON [dbo].[PotentialMatchingGift] ([MatchingGiftPlanKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_PotentialMatchingGift_DonationPartKey] ON [dbo].[PotentialMatchingGift] ([OrderLineKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_PotentialMatchingGift_SystemEntityKey] ON [dbo].[PotentialMatchingGift] ([SystemEntityKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_PotentialMatchingGift_UpdatedByUserKey] ON [dbo].[PotentialMatchingGift] ([UpdatedByUserKey]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[PotentialMatchingGift] ADD CONSTRAINT [FK_PotentialMatchingGift_MatchingGiftPlan] FOREIGN KEY ([MatchingGiftPlanKey]) REFERENCES [dbo].[MatchingGiftPlan] ([MatchingGiftPlanKey])
GO
ALTER TABLE [dbo].[PotentialMatchingGift] ADD CONSTRAINT [FK_PotentialMatchingGift_Relationship_MatchingGift] FOREIGN KEY ([MatchingGiftRelationshipKey]) REFERENCES [dbo].[RelationshipMain] ([RelationshipKey])
GO
ALTER TABLE [dbo].[PotentialMatchingGift] ADD CONSTRAINT [FK_PotentialMatchingGift_SystemEntity] FOREIGN KEY ([SystemEntityKey]) REFERENCES [dbo].[SystemEntity] ([SystemEntityKey])
GO
ALTER TABLE [dbo].[PotentialMatchingGift] ADD CONSTRAINT [FK_PotentialMatchingGift_UserMain_CreatedBy] FOREIGN KEY ([CreatedByUserKey]) REFERENCES [dbo].[UserMain] ([UserKey])
GO
ALTER TABLE [dbo].[PotentialMatchingGift] ADD CONSTRAINT [FK_PotentialMatchingGift_UserMain_UpdatedBy] FOREIGN KEY ([UpdatedByUserKey]) REFERENCES [dbo].[UserMain] ([UserKey])
GO